<%--
  Created by IntelliJ IDEA.
  User: Administrator
  Date: 2019/11/28 0028
  Time: 17:36
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>
    <script src="jquery/jquery-3.0.0.min.js"></script>
    <script>
        $(function () {
            $("#d1").change(function () {
                var shen = $(this).val();
                $.ajax({
                    type:"get",
                    url:"${pageContext.request.contextPath}/cservlet",
                    data:"shen="+shen,
                    success:function (msg) {
                        $("#d2").empty();
                       var citys = msg.split(",");
                       $.each(citys,function (index,ele) {
                           $("#d2").append("<option>"+ele+"</option>");
                       })
                    }
                })
            })
        })
    </script>
</head>
<body>
<select name="shen" id="d1">
    <option value="0">江苏</option>
    <option value="1">四川</option>
    <option value="2">广东</option>
    <option value="3">浙江</option>
</select>
<select name="city" id="d2"></select>
</body>
</html>
